package com.jajahome.feature;

import android.content.Intent;
import android.os.Bundle;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.view.WindowManager;

import com.jajahome.R;
import com.jajahome.base.GuildPagerAdapter;
import com.jajahome.feature.home.MainAty;
import com.jajahome.util.GuildUtil;
import com.jajahome.widget.banner.SyCirclePageIndicator;

/**
 * 引导页
 */
public class GuildAct extends AppCompatActivity {
	private ViewPager viewPager;  //viewpager
	private SyCirclePageIndicator indicator; //指示器
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.act_guild);
		viewPager = (ViewPager) findViewById(R.id.viewpager);
		indicator = (SyCirclePageIndicator) findViewById(R.id.indicator);
		GuildPagerAdapter adapter = new GuildPagerAdapter(getSupportFragmentManager());
		viewPager.setAdapter(adapter);
		indicator.setViewPager(viewPager);
		findViewById(R.id.btn_skip).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				//设置该应用已经启动过
				GuildUtil.setIsNotFirst(GuildAct.this);
				Intent intent = new Intent(GuildAct.this, MainAty.class);
				startActivity(intent);
				finish();
			}
		});
	}

}
